import { createWebHashHistory, createRouter } from "vue-router";

import HomeView from "../views/home/index.vue";
import loginView from '../views/login.vue'
import homes from '../views/home/home.vue'
import classify from '../views/home/classify.vue'
import cart from '../views/home/cart.vue'
import my from '../views/home/my.vue'
const routes = [
    // 重定向
    { path: '/', redirect: '/home' },
    {
        path: "/home",
        component: HomeView,
        children: [
            {
                path: "homes",
                component: homes,
            },
            {
                path: "classify",
                component: classify,
            },
            {
                path: "cart",
                component: cart,
            },
            {
                path: "my",
                component: my,
            },
        ]
    },
    {
        path: "/login",
        component: loginView
    },
]

export const router = createRouter({
    history: createWebHashHistory(),
    routes,
});
